Copy Objects to Module

Hi,
I am currently trying to create a block of DXL program which will copy an object from a module into a new module. How would I go about writing this?
Thanks!
josiah820 - Thu May 31 09:31:15 EDT 2012

Re: Copy Objects to Module
Mathias Mamsch - Thu May 31 16:23:56 EDT 2012

I would borrow from copyops.inc which actually has functions for doing this. It defines a
 

// see ... lib\dxl\example\include\copyops.inc
void copyObject(Object oldObj, newObj, Module baseMod)

 


function which will actually copy all attribute values from one object to another, creating necessary attributes on the fly. However it probably misses copying of DOORS/external links so it really depends on what you want. But it should be a good starting point. A more complete example is the copy object GUI which you can find under 'lib\dxl\example\copyobj.dxl' in your DOORS directory.

Maybe that helps, regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: Copy Objects to Module
josiah820 - Wed Jun 06 11:42:01 EDT 2012

Mathias Mamsch - Thu May 31 16:23:56 EDT 2012

I would borrow from copyops.inc which actually has functions for doing this. It defines a
 

// see ... lib\dxl\example\include\copyops.inc
void copyObject(Object oldObj, newObj, Module baseMod)

 


function which will actually copy all attribute values from one object to another, creating necessary attributes on the fly. However it probably misses copying of DOORS/external links so it really depends on what you want. But it should be a good starting point. A more complete example is the copy object GUI which you can find under 'lib\dxl\example\copyobj.dxl' in your DOORS directory.

Maybe that helps, regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

I tried implementing this code, and it isn't working. I have an object o, a "current" module l, and m, the module that I want to copy o (the current object) to. If i'm implementing this code, I'm assuming the method call would be something like:
 

copyObject(o, o, m)

 


If I copy the copyops.inc into my program.
Is this the correct way to implement it? It's not putting anything into m, so I'm assuming something is wrong.
Thanks

 

Re: Copy Objects to Module
josiah820 - Wed Jun 06 11:42:22 EDT 2012

code not working

Re: Copy Objects to Module
llandale - Wed Jun 06 17:05:58 EDT 2012

josiah820 - Wed Jun 06 11:42:01 EDT 2012

I tried implementing this code, and it isn't working. I have an object o, a "current" module l, and m, the module that I want to copy o (the current object) to. If i'm implementing this code, I'm assuming the method call would be something like:
 

copyObject(o, o, m)

 


If I copy the copyops.inc into my program.
Is this the correct way to implement it? It's not putting anything into m, so I'm assuming something is wrong.
Thanks

 

You need different handles for your from and to Objects; right now you are copying values of "o" to Object "o", which won't change anything. The 2nd parameter should be perhaps "oM", the object in "m" you wish new values for.

-Louie

Re: Copy Objects to Module
josiah820 - Thu Jun 07 10:08:22 EDT 2012

Mathias Mamsch - Thu May 31 16:23:56 EDT 2012

I would borrow from copyops.inc which actually has functions for doing this. It defines a
 

// see ... lib\dxl\example\include\copyops.inc
void copyObject(Object oldObj, newObj, Module baseMod)

 


function which will actually copy all attribute values from one object to another, creating necessary attributes on the fly. However it probably misses copying of DOORS/external links so it really depends on what you want. But it should be a good starting point. A more complete example is the copy object GUI which you can find under 'lib\dxl\example\copyobj.dxl' in your DOORS directory.

Maybe that helps, regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

What exactly is baseMod in this example? Is it the module that I am copying from, or is it the module that I'm copying to? I'm assuming the first one is the object that I'm copying and that the second is the new object, which I will be copying to in the new module, but what is that last argument?
Thanks

Re: Copy Objects to Module
josiah820 - Thu Jun 07 10:35:08 EDT 2012

llandale - Wed Jun 06 17:05:58 EDT 2012
You need different handles for your from and to Objects; right now you are copying values of "o" to Object "o", which won't change anything. The 2nd parameter should be perhaps "oM", the object in "m" you wish new values for.

-Louie

For some reason, even with oM as the second parameter, I can't get anything to be copied into "m"?